<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>向 FTP 服务器发送命令</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ftp-raw" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ftp_raw</h1>
  <p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ftp_raw</span> &mdash; <span class="dc-title">向 FTP 服务器发送命令</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.ftp-raw-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ftp_raw</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$ftp_stream</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$command</code></span>
   ) : <span class="type">array</span></div>

  <p class="para rdfs-comment">
   向 FTP 服务器发送任意 <code class="parameter">command</code>。 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.ftp-raw-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">ftp_stream</code></dt>

     <dd>

      <p class="para">
       FTP 连接标示符。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">command</code></dt>

     <dd>

      <p class="para">
       要执行的命令。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.ftp-raw-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   将服务器的响应以字符串数组的形式返回。
   对于响应内容既不做解析处理，
   也不检测命令是否执行成功。
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.ftp-raw-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5329">
    <p><strong>Example #1 使用 <span class="function"><strong>ftp_raw()</strong></span> 登录远程 FTP 服务器</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ftp_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"ftp.example.com"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;等同于<br />&nbsp;&nbsp;&nbsp;ftp_login($fp,&nbsp;"joeblow",&nbsp;"secret");&nbsp;*/<br /></span><span style="color: #0000BB">ftp_raw</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"USER&nbsp;joeblow"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ftp_raw</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PASS&nbsp;secret"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.ftp-raw-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="ftp_exec.html" class="function" rel="rdfs-seeAlso">ftp_exec()</a> - 请求运行一条 FTP 命令</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>